Skip to main content
POST
/
api
/
v3
/
payment-links
Create a payment link [V3]
curl --request POST \
  --url https://api.loops.fi/api/v3/payment-links \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "line_items": [
    {
      "price": "<string>",
      "quantity": 1
    }
  ],
  "after_completion": {
    "hosted_confirmation": {
      "custom_message": "<string>"
    },
    "redirect": {
      "url": "<string>"
    },
    "type": "hosted_confirmation"
  },
  "allow_promotion_codes": false,
  "application_fee_amount": 123,
  "application_fee_percent": 123,
  "automatic_tax": {
    "enabled": false
  },
  "billing_address_collection": "auto",
  "consent_collection": {
    "promotions": "auto",
    "terms_of_service": "none"
  },
  "currency": "usd",
  "custom_fields": [
    {
      "key": "<string>",
      "label": {
        "custom": "<string>",
        "type": "custom"
      },
      "optional": false,
      "type": "dropdown"
    }
  ],
  "custom_text": {
    "after_submit": {
      "message": "<string>"
    },
    "shipping_address": {
      "message": "<string>"
    },
    "submit": {
      "message": "<string>"
    },
    "terms_of_service_acceptance": {
      "message": "<string>"
    }
  },
  "customer_creation": "if_required",
  "payment_method_collection": "if_required",
  "payment_method_types": [
    "card"
  ],
  "phone_number_collection": {
    "enabled": false
  },
  "shipping_address_collection": {
    "allowed_countries": [
      "<string>"
    ]
  },
  "submit_type": "auto",
  "subscription_data": {
    "description": "<string>",
    "trial_period_days": 123
  },
  "tax_id_collection": {
    "enabled": false
  },
  "transfer_data": {
    "amount": 123,
    "amount_percent": 123,
    "destination": "<string>"
  },
  "metadata": {},
  "label": "<string>",
  "productIds": [
    "<string>"
  ],
  "successUrl": "<string>",
  "cancelUrl": "<string>"
}'
{
  "id": "<string>",
  "object": "payment_link",
  "active": true,
  "after_completion": {
    "hosted_confirmation": {
      "custom_message": "<string>"
    },
    "redirect": {
      "url": "<string>"
    },
    "type": "hosted_confirmation"
  },
  "allow_promotion_codes": true,
  "application_fee_amount": 123,
  "application_fee_percent": 123,
  "automatic_tax": {
    "enabled": true
  },
  "billing_address_collection": "auto",
  "consent_collection": {
    "promotions": "auto",
    "terms_of_service": "none"
  },
  "currency": "<string>",
  "custom_fields": [
    {
      "key": "<string>",
      "label": {
        "custom": "<string>",
        "type": "custom"
      },
      "optional": true,
      "type": "dropdown"
    }
  ],
  "custom_text": {
    "after_submit": {
      "message": "<string>"
    },
    "shipping_address": {
      "message": "<string>"
    },
    "submit": {
      "message": "<string>"
    },
    "terms_of_service_acceptance": {
      "message": "<string>"
    }
  },
  "customer_creation": "always",
  "line_items": {
    "data": [
      {
        "id": "<string>",
        "object": "item",
        "price": {
          "id": "<string>",
          "object": "price",
          "active": true,
          "billing_scheme": "per_unit",
          "created": 123,
          "currency": "<string>",
          "custom_unit_amount": {
            "maximum": 123,
            "minimum": 123,
            "preset": 123
          },
          "livemode": true,
          "lookup_key": "<string>",
          "metadata": {},
          "nickname": "<string>",
          "product": "<string>",
          "recurring": {
            "aggregate_usage": "last_during_period",
            "interval": "day",
            "interval_count": 123,
            "trial_period_days": 123,
            "usage_type": "licensed"
          },
          "tax_behavior": "exclusive",
          "tiers_mode": "graduated",
          "transform_quantity": {
            "divide_by": 123,
            "round": "down"
          },
          "type": "one_time",
          "unit_amount": 123,
          "unit_amount_decimal": "<string>"
        },
        "quantity": 123
      }
    ],
    "has_more": true,
    "object": "list",
    "total_count": 123,
    "url": "<string>"
  },
  "livemode": true,
  "metadata": {},
  "on_behalf_of": "<string>",
  "payment_method_collection": "always",
  "payment_method_types": [
    "<string>"
  ],
  "phone_number_collection": {
    "enabled": true
  },
  "shipping_address_collection": {
    "allowed_countries": [
      "<string>"
    ]
  },
  "submit_type": "auto",
  "subscription_data": {
    "description": "<string>",
    "trial_period_days": 123
  },
  "tax_id_collection": {
    "enabled": true
  },
  "transfer_data": {
    "amount": 123,
    "amount_percent": 123,
    "destination": "<string>"
  },
  "url": "<string>",
  "label": "<string>",
  "products": [
    {
      "id": "<string>",
      "name": "<string>",
      "description": "<string>",
      "price": 123,
      "currency": "<string>",
      "type": "recurring",
      "status": "<string>",
      "quantity": 123,
      "displayOrder": 123
    }
  ],
  "successUrl": "<string>",
  "cancelUrl": "<string>",
  "allowDiscountCodes": true,
  "collectBilling": true,
  "views": 123,
  "conversions": 123,
  "revenue": 123,
  "status": "active",
  "merchant": {
    "id": "<string>",
    "companyName": "<string>",
    "logo": "<string>"
  }
}

Authorizations

Authorization
string
header
required

API Key authentication using Bearer token

Body

application/json
  • Option 1
  • Option 2
line_items
object[]
required

The line items representing what is being sold

after_completion
object
allow_promotion_codes
boolean
default:false

Whether the payment link's url is active

application_fee_amount
number

The amount of the application fee

application_fee_percent
number

The percentage of the application fee

automatic_tax
object
billing_address_collection
enum<string>
default:auto

Configuration for collecting the customer's billing address

Available options:
auto,
required
currency
string
default:usd

Three-letter ISO currency code

custom_fields
object[]
custom_text
object
customer_creation
enum<string>
default:if_required

Configuration for collecting the customer's email address

Available options:
always,
if_required
payment_method_collection
enum<string>
default:if_required

Configuration for collecting payment method details

Available options:
always,
if_required
payment_method_types
enum<string>[]

The list of payment method types that customers can use

phone_number_collection
object
shipping_address_collection
object
submit_type
enum<string>
default:auto

Describes the type of transaction being performed

Available options:
auto,
book,
donate,
pay
subscription_data
object
tax_id_collection
object
transfer_data
object
metadata
object

Set of key-value pairs that you can attach to an object

label
string

Payment link label (Loops-specific)

Maximum length: 100
productIds
string[]

Array of product IDs to include in this payment link (Loops-specific)

Minimum length: 1
successUrl
string<uri>

Success redirect URL (Loops-specific)

cancelUrl
string<uri>

Cancel redirect URL (Loops-specific)

Response

Default Response

id
string

Unique identifier for the object

object
enum<string>

String representing the object's type

Available options:
payment_link
active
boolean

Whether the payment link's url is active

after_completion
object
allow_promotion_codes
boolean

Whether the payment link's url is active

application_fee_amount
number | null

The amount of the application fee

application_fee_percent
number | null

The percentage of the application fee

automatic_tax
object
billing_address_collection
enum<string>
Available options:
auto,
required
currency
string

Three-letter ISO currency code

custom_fields
object[]
custom_text
object
customer_creation
enum<string>
Available options:
always,
if_required
line_items
object
livemode
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode

metadata
object

Set of key-value pairs that you can attach to an object

on_behalf_of
string | null
payment_method_collection
enum<string>
Available options:
always,
if_required
payment_method_types
string[]

The list of payment method types that customers can use

phone_number_collection
object
shipping_address_collection
object | null
submit_type
enum<string>
Available options:
auto,
book,
donate,
pay
subscription_data
object | null
tax_id_collection
object
transfer_data
object | null
url
string<uri>

The URL to the payment link

label
string

Payment link label (Loops-specific)

products
object[]
successUrl
string<uri> | null

Success redirect URL (Loops-specific)

cancelUrl
string<uri> | null

Cancel redirect URL (Loops-specific)

allowDiscountCodes
boolean
collectBilling
boolean
views
number
conversions
number
revenue
number
status
enum<string>
Available options:
active,
expired,
disabled
merchant
object
I